﻿<UserControl x:Class="Marking.Dashboard.Views.Finance.FinancePieChartView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"  
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Styles/Style.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <vc:Chart Style="{StaticResource ChartStyle}">
            <vc:Chart.Titles>
                <vc:Title Text="{Binding Title}" Style="{StaticResource ChartTitleStyle}"/>
            </vc:Chart.Titles>

            <vc:Chart.AxesX>
                <vc:Axis Title="项目">
                </vc:Axis>
            </vc:Chart.AxesX>

            <vc:Chart.AxesY>
                <vc:Axis Suffix="元"/>
            </vc:Chart.AxesY>

            <vc:Chart.Series>
                <vc:DataSeries 
                        RenderAs="Pie" 
                        LabelEnabled="True" 
                        Style="{StaticResource DataSeriesStyle}"
					    MouseLeftButtonUp="DataSeries_MouseLeftButtonUp"
                        DataSource="{Binding BindsDirectlyToSource=True}">
                    <vc:DataSeries.DataMappings>
                        <vc:DataMapping MemberName="AxisXLabel" Path="ItemName"/>
                        <vc:DataMapping MemberName="YValue" Path="Quantity"/>
                    </vc:DataSeries.DataMappings>
                </vc:DataSeries>
            </vc:Chart.Series>
        </vc:Chart>
    </Grid>
</UserControl>
